home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
packet
/
p_tapr
/
tnchst
/
blp.do4
< prev
next >
Wrap
Text File
|
1992-03-16
|
29KB
|
479 lines
.HE BL╨ 3.σ Jaε 91
.FO #
.IG
.IG
.OJ ON
.PN 1
.IG Documen⌠ dedicateΣ t∩ thσ publiπ domaiε b∙ N2WX
.IG
.IG Retentioε oµ authorshi≡ noticσ woulΣ no⌠ bσ inappropriate
.IG
.IG
.IG
.OJ ON
.IG Notσ tha⌠ i≤ i≤ ß WordSta≥ 6.0 file. Iµ yo⌡ arσ printinτ this
.IG
.IG oε somethinτ othe≥ thaε WordSta≥ 6.0 yo⌡ ma∙ havσ troublσ with
.IG
.IG thσ statσ tables. Correc⌠ printinτ oµ thσ statσ table≤
.IG
.IG require≤ ß 17cpΘ landscapσ fon⌠ (ex, lineprinter17 oε ß laserjet3)
.IG
.OJ ON
WARNIN╟ - EXPERIMENTER╙ ONLY!
Hos⌠ ámodσ oε TNC-2 anΣ derivativσ TNC≤ a⌠ thi≤ timσ remain≤ ì
experimental. Obviou≤ feature≤ receiveΣ ß quicδ "goinτ over" anΣ ì
rathe≥ ácursor∙ ádebug, bu⌠ discover∙ oµ thσ remaininτ inevitablσ ì
bug≤ áanΣ ácritica∞ programminτ oversight≤ await≤ thσ adventurou≤ ì
reader/developer. Pleasσ direc⌠ discoverie≤ anΣ criticisms:
viß slo≈ boa⌠ : t∩ HowarΣ Goldstein
5201-23rΣ Ave. N.
St. Petersburg, F╠ 33710 USA
viß compuser÷ : t∩ 75006,702
viß haφ packet: t∩ N2W╪ @ W4DPH.FL
Introduction
Thi≤ documen⌠ describe≤ thσ networδ laye≥ interfacσ useΣ iε TNC-2'≤ ì
binar∙ interfacσ "host" modσ protocol, "BLP."
Wherσ i⌠ fit≤ in
BL╨ i≤ ß methoΣ fo≥ interfacinτ aε automateΣ applicatioε t∩ ß BLP-ì
capablσ AX.25 termina∞ nodσ controller.
| |
| Applicatioε |
|(transpor⌠ intfc)| ^~~~~<> R╞ t∩ peer
+++++++++++++++++++ ________|________
| | | |
| | | |
| Compute≥ drive≥ | | TN├ drive≥ |
| (networδ intfc) | | (networδ intfc) |
| | | |
---------------------------- ----------------------------
Binar∙ Linδ Protoco∞ |*******| Binar∙ Linδ Protoco∞
(describeΣ b∙ thi≤ document)| | (describeΣ b∙ thi≤ document)
___________________________▀ ____________________________
| | | |
| | | |
| DL├ |*********| DL├ |
| (defineΣ elsewhere) | | (defineΣ elsewhere) |
┌────────────────────────────┐ ┌────────────────────────────┐
│ QAF╘ │ │ QAF╘ │
│ (defineΣ elsewhere) │.........│ (defineΣ elsewhere) │
│ │ │ │
└────────────────────────────┘ └────────────────────────────┘
Key:
...... Onσ physica∞ connection
****** Onσ o≥ morσ logica∞ connections
BL╨ encapsulation
┴ BL╨ interfacσ communicate≤ witΦ it≤ pee≥ interfacσ b∙ sendinτ BL╨ ì
packet≤ t∩ anΣ receivinτ theφ froφ thσ underlyinτ DL├ machine.
.CP 15
BL╨ packe⌠ structure
ìè
.OJ OFF
>| LCNbytσ | CTRLbytσ | [variablσ pe≥ CTRL▌ |<
.OJ ON
byte:: 8 bi⌠ unsigneΣ integer
wΣ :: 16 bi⌠ unsigneΣ intege≥ transmitteΣ a≤ tw∩ 'bytes', leas⌠ sigì
nifican⌠ bytσ firs⌠
LCN : Logica∞ channe∞ t∩ whicΦ thσ BL╨ packe⌠ corresponds.
LC╬ 0-6F :: Gen'lly, link≤ initiateΣ b∙ ß terminal, t∩ ß TN├
LC╬ 70-7f :: Specia∞ permanentl∙ connecteΣ functions
******
LC╬ 70 - TN├ globa∞ commanΣ anΣ configuration
LC╬ 71 - TN├ broadcas⌠ channel
--- d∩ NO╘ issuσ cal∞ setu≡ packet≤ t∩ the
broadcas⌠ channel. TNC-2 ma∙ balδ iµ yo⌡ do.
LC╬ 72-7f - reserved
******
LC╬ 80-EF :: Gen'lly, link≤ initiateΣ b∙ ß TNC, t∩ ß terminal.
LC╬ F0-FF :: reserved
CTRL : typσ oµ packe⌠
hex
---
02 C╙ - Cal∞ setup (request)
12 CSEMAI╠ - Cal∞ setu≡ , outgτ emai∞ ** no⌠ TNC-2
04 CC├ - Cal∞ connected (response)
08 CCL╥ - Cal∞ clear (request)
09 CCLR─ - Cal∞ cleared (response)
10 CSTEN╤ - Cal∞ statu≤ enquiry
(request)
11 CSTRE╨ - Cal∞ statu≤ reply (response)
20 UDAT┴ - UnsequenceΣ data (request)
8X DDAT┴ - SequenceΣ data (request)
9X DAC╦ - SequenceΣ datß acknowledgement
(response)
AX DBUS┘ - SequenceΣ datß acknowledgemen⌠ anΣ bus∙ indication
(response)
.CP 3
Defininτ BLP
BL╨ i≤ ß balanceΣ protocol. Sincσ therσ arσ n∩ master-slavσ relationì
ships, an∙ onσ BL╨ devicσ caε communicatσ witΦ an∙ othe≥ electricall∙ ì
connecteΣ BL╨ device. (fo≥ ex., onσ computer-onσ TNC, o≥ tw∩ computì
er≤ anΣ n∩ TNCs, o≥ tw∩ TNC≤ back-to-back).
BL╨ i≤ describeΣ anΣ implementeΣ a≤ multiplσ independen⌠ event-driveε ì
finite-statσ machines.
BL╨ Objects
EacΦ BL╨ linδ use≤ thesσ variable≤ anΣ objects:
BSTATE: Onσ ááoµ áán ástates. á(seσ ásectioε áoε áBL╨ ástates, ì
below)
BQUEUE: FIF╧ ááqueuσ áoµ ápacket≤ áa≤ áye⌠ áunacknowledgeΣ áb∙ ì
thσ pee≥ BL╨ device.
BL╨ States
Therσ arσ fivσ Supervisor∙ state≤ anΣ fou≥ Datß states. Thσ Datß ì
state≤ arσ valiΣ onl∙ wheε thσ Supervisor∙ statσ i≤ BSDATA. Seσ thσ ìèappendi° fo≥ thσ statσ tables.
Supervisor∙ State≤ - ├ packets
BSIDLE
Thσ BL╨ linδ i≤ no≈ inactivσ anΣ await≤ eithe≥ (1) receip⌠ oµ ß call-ì
setu≡ (CS) packet; (2) loca∞ commanΣ t∩ initiatσ aε outgoinτ cal∞ froφ ì
thσ upper-leve∞ driver; (3) datagram.
Wheε thσ statσ i≤ BSIDLE, thσ BL╨ machinσ i≤ completel∙ idlσ excep⌠ ì
tha⌠ thσ machinσ respond≤ t∩ receiveΣ CCLR commanΣ packe⌠ event≤ witΦ ì
ß CCLRD indication.
Iµ thσ BL╨ machinσ receive≤ CS, i.e. iµ i⌠ i≤ called, i⌠ shal∞ responΣ ì
witΦ ß call-accepteΣ (CA) packe⌠ anΣ star⌠ it≤ attemp⌠ t∩ se⌠ u≡ it≤ ì
upper-leve∞ application. Fo≥ example, iµ BL╨ i≤ implementeΣ oε ß TNC, ì
receip⌠ oµ ß CS cause≤ thσ TNC'≤ AX.25 machinσ t∩ begiε ß connectioε ì
attempt.
BSRCSETUP
Thσ BL╨ machinσ enter≤ thi≤ statσ wheε thσ local, upper-leve∞ applicaì
tioε command≤ onσ oµ it≤ idlσ BL╨ machine≤ t∩ setu≡ ß connectioε t∩ ß ì
remotσ BL╨ device. Wheε ß BTIMER-expireΣ even⌠ occurs, thσ machinσ iε ì
thi≤ statσ send≤ ß CS packe⌠ t∩ thσ peer.
Thσ BL╨ machinσ leave≤ thi≤ statσ wheε (1) ß cal∞ accepteΣ (CA) indiì
catioε i≤ received; o≥ (2) ß cal∞ clea≥ (CCLR) commanΣ i≤ received; o≥ ì
(3) thσ retr∙ limi⌠ i≤ exceeded; (4) ß collisioε occur≤ i.e. ß CS ì
packe⌠ i≤ received; o≥ (5) thσ loca∞ applicatioε command≤ thσ BL╨ t∩ ì
clea≥ thσ connection.
BSLCSETUP
┴ calleΣ BL╨ machinσ enter≤ thi≤ statσ afte≥ i⌠ begin≤ initiatinτ ß ì
connectioε witΦ it≤ upper-leve∞ driver. Iµ thσ upper-leve∞ drive≥ i≤ ì
successfull∙ connecteΣ (ex: TN├ ablσ t∩ makσ it≤ AX.25 connection), ì
thσ machinσ enter≤ thσ BSDAT┴ state. Otherwise, iµ thσ connectioε ì
fails, thσ machinσ enter≤ thσ BSCLEARW╘ state.
BSCLEARWT
Thσ BL╨ machinσ i≤ iε thi≤ statσ wheε ß BL╨ linδ i≤ beinτ torε down. ì
Wheε ß BTIMER-expireΣ even⌠ occurs, thσ machinσ send≤ ß CCLR command. ì
CleareΣ indicatioε (CCLRD) packe⌠ receiveΣ anΣ retry-limi⌠ exceedeΣ ì
event≤ causσ thσ machinσ t∩ ente≥ it≤ idlσ state.
BSDATA
Thσ BL╨ machine'≤ local, upper-leve∞ applicatioε i≤ read∙ t∩ transfe≥ ì
datß witΦ aε activσ remotσ BLP. Al∞ 'D' packet≤ arσ passeΣ t∩ thσ ì
Datß machine.
.CP 3
Datß state≤ - ─ packets
DDATA
Thσ remotσ BL╨ i≤ read∙ t∩ receivσ datß packets. Thσ statσ change≤ t∩ ì
DWAI╘ wheε ne≈ outgoinτ sequenceΣ datß packet≤ arσ enqueued. DDAT┴ ì
statσ i≤ reentereΣ oncσ al∞ outstandinτ packet≤ arσ acknowledged.
DWAIT
Thσ BL╨ machinσ ha≤ datß outstandinτ fo≥ thσ remotσ BLP, anΣ i≤ awaitì
inτ ß response. Iµ ß BTIMER-expireΣ even⌠ occurs, thσ datß packe⌠ i≤ ì
retransmitted. Iµ ß DAC╦ o≥ DBUS┘ packe⌠ acknowledginτ al∞ outstand
.OJ OFF
inτ packet≤ i≤ received, thσ statσ change≤ t∩ DDATA.
.OJ ON
BL╨ packe⌠ types
ìè
Supervisor∙ packets
C╙ - Cal∞ setup
format:
.OJ OFF
|LCN|02|[called_address][calling_parameters]|
.OJ ON
┴ sequenceΣ BL╨ linδ i≤ precedeΣ b∙ thσ cal∞ setu≡ phase. ┴ devicσ ì
direct≤ ß C╙ packe⌠ toward≤ anothe≥ devicσ capablσ oµ reachinτ thσ ì
[calleΣ address].
Wheε ß devicσ receive≤ ß C╙ packet, iµ thσ LC╬ i≤ no⌠ alread∙ iε usσ ì
thσ devicσ shal∞ binΣ ß loca∞ uppe≥ leve∞ contro∞ structurσ t∩ thσ ì
LCN, configurσ thσ specifieΣ calling_parameters, commanΣ thσ uppe≥ ì
leve∞ t∩ opeε ß linδ t∩ thσ called_addres≤ specified, anΣ a⌠ somσ timσ ì
iε thσ futurσ responΣ witΦ eithe≥ CC├ o≥ CCLRD. Fo≥ example, ß TNC-2 ì
bind≤ thσ LC╬ t∩ onσ oµ it≤ AX.25 connection-contro∞ blocks, start≤ ì
thσ connectioε attemp⌠ t∩ thσ called_address, get≤ connected, anΣ ì
respond≤ witΦ ß CCC.
Wheε ß devicσ currentl∙ sendinτ C╙ packet≤ oε thσ LC╬ (i.e., iε thσ ì
BSRCSETU╨ state) receive≤ ß C╙ packet, ß collisioε ha≤ occurred, anΣ ì
thσ connectioε i≤ terminated.
.CP 3
C╙ addres≤ formats:
[called_address]
Nul∞ áááterminateΣ ááádestinatioε áááAX.25 ááácallsigε ááanΣ ì
digipeater≤ áááiε áááAX.25/HDL├ áááformat, áái.e. áálef⌠ ááshiftì
ed.
[calling_parms]
RFU; ááusσ ááBL╨ ááchanne∞ áát∩ áTN├ ácommanΣ áinterfacσ át∩ ì
selec⌠ thesσ iε thσ meantime.
CC├ - Cal∞ connected
format:
|LCN|04|
Wheε thσ devicσ receivinτ ß C╙ packe⌠ ha≤ (1) bounΣ thσ LC╬ t∩ it≤ ì
upper-leve∞ handler, (2) commandeΣ thσ upper-leve∞ t∩ opeε ß connecì
tion, anΣ (3) successfull∙ connecteΣ thσ upper-leve∞ handle≥ t∩ thσ ì
networδ called_address, thσ devicσ send≤ ß CC├ anΣ enter≤ thσ BSDAT┴ ì
state.
.CP 4
CCL╥ - Cal∞ clear
format:
|LCN|08|[reason_code]|
┴ devicσ attemptinτ t∩ closσ thσ LC╬ indicate≤ thσ attemp⌠ b∙ sendinτ ì
CCLR. Thσ reason_codσ (forma⌠ t∩ bσ determined) explain≤ why; ex:
.OJ OFF
upper-leve∞ busy, retr∙ failure, cal∞ collision, etc.
.OJ ON
Meaninτ oµ "generic" [reason_code]s:
ìè
0:= Remotσ requesteΣ (typical)
1:= BL╨ couldn'⌠ connec⌠ LC╬ (eithe≥ ou⌠ oµ contro∞ block≤ o≥ ì
faileΣ t∩ finΣ ß freσ channe∞ t∩ connec⌠ witΦ o≥ alread∙ connecteΣ t∩ ì
tha⌠ station)
Meaninτ oµ [reason_code]≤ onl∙ sen⌠ b∙ ß TNC≤ witΦ BLP:
2:= CalleΣ AX.25 addres≤ wa≤ busy
3:= (No≈ disconnected) AX.25 linδ associateΣ witΦ thi≤ addres≤ ì
retrieΣ out
.CP 10
CCLR─ - Cal∞ cleared
format:
|LCN|09|
┴ responsσ t∩ ß CCL╥ command, indicate≤ receip⌠ oµ thσ clea≥ commanΣ ì
anΣ successfu∞ unbindinτ oµ thσ LCN.
CSTEN╤ - Cal∞ statu≤ enquiry
format:
|LCN|10|
Cause≤ thσ devicσ t∩ returε ß CSTRE╨ statu≤ repl∙ packet
.CP 7
CSTRE╨ - Cal∞ statu≤ reply
format:
|LCN|11|[status]|
Responsσ t∩ CSTEN╤ enquir∙ packet. Fina∞ forma⌠ oµ [status▌ t∩ bσ ì
determined; preliminary:
status[0▌ = LCN'≤ curren⌠ supervisor∙ statσ #
status[1▌ = LCN'≤ curren⌠ datß statσ #
status[2..n▌ = LCN'≤ uppe≥ leve∞ statu≤
ex: TN├ respond≤ status[2▌ = AX.25 state
status[3▌ = appro° # oµ unacknowledgeΣ
AX.25 packets
UDAT┴ - UnnumbereΣ data
format:
|70|20|[called_address]|[data0...datan]|
Broadcas⌠ datß commanΣ packet. GenerateΣ b∙ TN├ upoε receip⌠ oµ AX.25 ì
U╔ frame. TN├ generate≤ U╔ framσ wheε i⌠ receive≤ ß BL╨ UDAT┴ packet.
Recal∞ tha⌠ LC╬ 0x70 i≤ permanentl∙ connected; d∩ no⌠ attemp⌠ t∩ C╙ ì
channe∞ 0x70 (TNC-2)
ìè
DDAT┴ - SequenceΣ datß commanΣ packet
format:
|LCN|8x|[data0...datan]|
° :: sequencσ number, moΣ 16
DAC╦ - SequenceΣ datß acknowledgement
format:
|LCN|9x|
° :: sequencσ number, moΣ 16
Acknowledge≤ packet≤ througΦ sequencσ numbe≥ 'x'-1
DBUS┘ - SequenceΣ datß acknowledgement/busy
format:
|LCN|Ax|
° :: sequencσ number, moΣ 16
Acknowledge≤ packet≤ througΦ sequencσ numbe≥ 'x'-1 anΣ inabilit∙ t∩ ì
receivσ sequencσ numbe≥ x.
.PA è
SUPERVISOR┘ PACKE╘ RECEIVE─ EVENTS
│ Cal∞ Setup │Cal∞ connected │Cal∞ clear │Cal∞ cleared │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│Star⌠ local, │ │SenΣ call │ │
BSIDLE │ │ │cleared, │ │
│BSstate->BSLCSETUP │ │BSstate->BSIDLE │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ │Sto≡ local, │ │
BSLCSETUP│ │ │BSstate->BSIDLE │ │
│ │ │ │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│Sto≡ local, │BSstate->BSDATA, │ " │ │
BSRCSETUP│BSstate- │BDstate->BDIDLE │ │ │
│(*collision* │ │ │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ │ " │ │
BSCLEARWT│ │ │ │BSstate->BSIDLE │
│ │ │ │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ │ " │ │
BSDATA │ │ │ │ │
│ │ │ │ │
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
Statσ Changes: Implici⌠ iε eacΦ describeΣ statσ changσ is:
1. settinτ BTIME╥ t∩ expired, and
2. thσ zeroinτ oµ thσ Retr∙ count.
Cal∞ Statu≤ packet: ┴ call-status-repl∙ (CSTREP) packe⌠ i≤ sen⌠ wheneve≥ a
call-status-enquir∙ (CSTENQ) packe⌠ i≤ received.
.PA è
LOCA╠ SUPERVISOR┘ EVENTS
│ Local │Loca∞ sto≡ or │Succesfull∙ connected│intentionally │Retry-limit │ BTIMER │
│outgoinτ start │opeε failure │t∩ upper, loca∞ layer│blank │ exceeded │ expired │
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ │ │ │ │ │
BSIDLE │BSstate->BSRCSETUP │ │ │ │ │ │
│ │ │ │ │ │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │Sto≡ local, │SenΣ CCC, │ │Sto≡ local, │ │
BSLCSETUP│ │BSstate->BSCLEARWT │BSstate->BSDATA, │ │ BSstate->BSCLEARWT │ │
│ │ │BDstate->BDIDLE │ │ │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ " │ │ │ " │SenΣ call │
BSRCSETUP│ │ │ │ │ │ setu≡ & restart │
│ │ │ │ │ │ btimer │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ " │ │ │BSstate->BSIDLE │SenΣ call │
BSCLEARWT│ │ │ │ │ │ clea≥ & restart │
│ │ │ │ │ │ BTIMER │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ │ " │ │ │Sto≡ local, │(seσ Datß table) │
BSDATA │ │ │ │ │ BSstate->BSCLEARWT │
│ │ │ │ │ │ │
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
.PA è
DAT┴ LEVE╠ STAT┼ TABLE
|Ne≈ outgoinτ data |Al∞ outgoinτ data | BTIME╥ expired, or |ReceiveΣ DDAT┴ but | Received | Received |
| arσ queued | werσ acknowledged |rxΣ unsoliciteΣ CSTREP| we'rσ busy | DDATA | DAC╦ o≥ DBUSY |
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
| | | |SenΣ DBUSY, | DATAPROC | ACKPROC |
BDIDLE |BDstate->BDWAIT | | |BDstate->BDBSY | (respond≤ with | (signal≤ all-ack'd |
| | | | | DACK) |events&free≤ txqueue)|
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
| | |Transmi⌠ queued |SenΣ DBUSY, | " | " |
BDWAIT | |BDstate->BDIDLE | data, restart |BDstate->BDBSYWT | | |
| | | BTIMER | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
| | | | | | " |
BDBSY |BDstate->BDBSYWT | | | | | |
| | | | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
| | |Transmi⌠ queued | | | " |
BDBSYWT | |BDstate->BDBSY | data, restart | | | |
| | | BTIMER | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|We'rσ n∩ longer | Received | | | | |
| busy | CSTREQ | | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
| | | | | | |
BDIDLE | |SenΣ CSTREP | | | | |
| | | | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
| | | | | | |
BDWAIT | |SenΣ CSTREP | | | | |
| | | | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|SenΣ CSTREP, | | | | | |
BDBSY |BDstate->BDIDLE |SenΣ CSTREP | | | | |
| | | | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|SenΣ CSTREP, | | | | | |
BDBSYWT |BDstate->BDWAIT |SenΣ CSTREP | | | | |
| | | | | | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────